'use strict';
var even_asc_odd_desc = function(collection){
  var even_num = []
  var odd_num = []
  var num = []
  for (let i = 0; i < collection.length; i++) {
    if(collection[i]%2==0){
      even_num.push(collection[i])
    }else {
      odd_num.push(collection[i])
    }
  }
  odd_num.sort(function(a, b){return b - a});
  even_num.sort(function (a,b){return a - b});
  for (let i = 0; i < even_num.length; i++) {
    num.push(even_num[i]);
  }
  for (let i = 0; i < odd_num.length; i++) {
    num.push(odd_num[i])
  }
  return num;
};
module.exports = even_asc_odd_desc;
